home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 23.zip / BS1 part 23 / Prof page II util.adf / HD / HDInstall < prev    next >
AmigaDOS Script File  |  1990-12-17  |  5KB  |  182 lines

  1. .KEY dest,help/s
  2. .BRA {
  3. .KET }
  4.  
  5. ; :ts=3
  6. ; HDInstall - Install Professional Page onto a hard drive.
  7. ;
  8. ; Inputs:
  9. ;    dest   Directory to install PPage into
  10. ;    help   Print instructions
  11. ;
  12.  
  13. ;
  14. ; Some preliminary setup.
  15. ;
  16. ASSIGN PPageInstUtil: PPageUtil:    ; Hook we can use when disk has been removed
  17. ASSIGN PPageInstOrig: ""            ; Save initial directory
  18.  
  19. ; Make sure he's running WB 1.3!
  20. ; Under 1.3, the "1 gt 2" test fails; we proceed to "FAILAT 10".
  21. ; Under 1.2, however, the IF command itself dies, since GT is not defined;
  22. ; execution is not suspended, and the ECHO and SKIP are seen.
  23. FAILAT 21
  24. IF >NIL: 1 gt 2
  25.         ECHO "*NVersion 1.3 of the Amiga Workbench software *E[;1mmust*E[m be"
  26.         ECHO "present before this installation can proceed.*N"
  27.         SKIP wrapup
  28. ENDIF
  29. FAILAT 10
  30.  
  31. ; Start with a fresh copy, to avoid any screwups
  32. IF EXISTS RAM:PPageInstall
  33.    DELETE RAM:PPageInstall/#? quiet
  34. ELSE
  35.    MAKEDIR RAM:PPageInstall
  36. ENDIF
  37.  
  38.  
  39. IF EXISTS C:COPY
  40.    C:COPY  C:Copy  RAM:PPageInstall
  41. ENDIF
  42. CD ram:PPageInstall    ; Search it without adding it to path
  43. IF EXISTS C:Assign
  44.    Copy C:Assign                   RAM:PPageInstall
  45. ENDIF
  46. IF EXISTS C:Echo
  47.    Copy C:Echo                     RAM:PPageInstall
  48. ENDIF
  49. IF EXISTS C:FailAt
  50.    Copy C:FailAt                   RAM:PPageInstall
  51. ENDIF
  52. IF EXISTS C:If
  53.    Copy C:If                       RAM:PPageInstall
  54. ENDIF
  55. IF EXISTS C:Else
  56.    Copy C:Else                     RAM:PPageInstall
  57. ENDIF
  58. IF EXISTS C:Endif
  59.    Copy C:Endif                    RAM:PPageInstall
  60. ENDIF
  61. IF EXISTS C:Makedir
  62.    Copy C:Makedir                  RAM:PPageInstall
  63. ENDIF
  64. IF EXISTS C:Execute
  65.    Copy C:Execute                  RAM:PPageInstall
  66. ENDIF
  67.  
  68. COPY PPageInstUtil:HD/DiskMount    RAM:PPageInstall
  69. COPY PPageInstUtil:HD/InstUtil     RAM:PPageInstall
  70. COPY PPageInstUtil:HD/Install-Proc RAM:PPageInstall
  71.  
  72. Assign PPageInstPgm:       ; Make sure these start fresh, too.
  73. Assign PPageInstCG:
  74.  
  75. ;
  76. ; Make sure needed system assignments exist.
  77. ;
  78. INSTUTIL isdir T:
  79. IF WARN
  80.    INSTUTIL isdir RAM:T
  81.    IF WARN
  82.       MAKEDIR ram:T
  83.    ENDIF
  84.    ASSIGN T: ram:T
  85. ENDIF
  86.  
  87. INSTUTIL isdir ENV:
  88. IF WARN
  89.    INSTUTIL isdir RAM:ENV
  90.    IF WARN
  91.       MAKEDIR ram:ENV
  92.    ENDIF
  93.    ASSIGN ENV: ram:ENV
  94. ENDIF
  95.  
  96.  
  97. ;
  98. ; HELP processing
  99. ;
  100. IF "{help}" eq "HELP"
  101.    SKIP showme
  102. ENDIF
  103.  
  104. INSTUTIL ask -dy "Do you need instructions [Y/N]? Y"
  105. IF WARN
  106.    SKIP noshow
  107. ENDIF
  108.  
  109. LAB showme
  110.    EXECUTE RAM:PPageInstall/DiskMount Program PPage: PPageInstPgm:
  111.    PPageInstPgm:showme PPageInstUtil:HD/HELP-Install
  112. LAB noshow
  113.  
  114.  
  115. ;
  116. ; Make sure that the destination exists, that its name is
  117. ; in a useable form (ie. that it ends with a '/' if it's a directory),
  118. ; and that the user in fact wants to install into it.
  119. ;
  120. IF NOT EXISTS "{dest$SYS:}"
  121.    ECHO "*N ********** Couldn't find Hard Disk drawer {dest$SYS:} **********"
  122.    SKIP forhelp
  123. ENDIF
  124.  
  125. INSTUTIL isdir "{dest$SYS:}"
  126. IF WARN
  127.    CD RAM:PPageInstall
  128.    ECHO "*N ********** {dest$SYS:} is not a drawer! **********"
  129. LAB forhelp
  130.    ECHO "*N For help, type"
  131.    ECHO "      EXECUTE PPageUtil:HD/HDInstall help"
  132.    ECHO "*N or double-click on the *"Help*" icon in this drawer*N"
  133.    SKIP wrapup
  134. ENDIF
  135. CD RAM:PPageInstall
  136.  
  137. ECHO "*N Answering *"No*" to the following question will cancel"
  138. ECHO " the installation.  Your hard drive will not be changed.*N"
  139. INSTUTIL ask -dy "Install Professional Page onto {dest$SYS:} [Y/N]? Y"
  140. IF warn
  141.    ECHO " Installation aborted!*N"
  142.    SKIP wrapup
  143. ENDIF
  144.  
  145. ECHO >ram:PPageInstall/DestPath1 "{dest$SYS:}"
  146. INSTUTIL <ram:PPageInstall/DestPath1 >ram:PPageInstall/DestPath2 fixdir
  147.  
  148. ASSIGN >nil: PPageInstDest: "{dest$SYS:}"
  149.  
  150. ECHO "*N*N ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*N"
  151. ECHO " Begin installation of Professional Page onto {dest$SYS:}*N"
  152.  
  153. INSTUTIL >ram:PPageInstall/TempScript mergenl "==EXECUTE >nil: ram:PPageInstall/Install-Proc """ ram:PPageInstall/DestPath2 "=="""
  154. EXECUTE ram:PPageInstall/TempScript
  155.  
  156. ECHO "*N*N --------------------------------------------------------------------"
  157. ECHO "  Please add the following command to the file s:Startup-sequence:"
  158. ECHO "*N        Execute s:PPageStartup"
  159.  
  160. ECHO "*N --------------------------------------------------------------------"
  161. ECHO "*N*N Installation of Professional Page complete."
  162. ECHO "*N ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*N"
  163.  
  164. ;
  165. ; Clean up after ourselves
  166. ; Can't depend on anything but PPageInstOrig: and PPageInstUtil:,
  167. ; since we can come here from right after their definition.
  168. ;
  169. LAB wrapup
  170.  
  171. CD PPageInstOrig:
  172. Assign PPageInstOrig:
  173. Assign PPageInstPgm:
  174. Assign PPageInstCG:
  175. Assign PPageInstDest:
  176.  
  177. DELETE >NIL: RAM:PPageInstall all quiet
  178.  
  179. PPageInstUtil:HD/InstUtil ask "Press RETURN."
  180. Assign PPageInstUtil:
  181.  
  182.